package cn.schoolwow.quickdao.test.entity;

import cn.schoolwow.quickdao.annotation.*;

import java.time.LocalDateTime;


@Comment("用户部门")
@UniqueField(columns = {"userId", "departmentId"})
@CompositeIndex(columns = {"userId", "departmentId"})
public class UserDepartment {
    @Id
    private long id;

    @Comment("用户id")
    @ForeignKey(table = User.class)
    private long userId;

    @Comment("部门id")
    @ForeignKey(table = Department.class)
    private long departmentId;

    @TableField(createdAt = true)
    private LocalDateTime createdAt;

    @TableField(updatedAt = true)
    private LocalDateTime updatedAt;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(long departmentId) {
        this.departmentId = departmentId;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}
